package com.jianqiao.delivery.pay.domain.initr2p;

import lombok.Data;

import java.util.List;

/**
 * author: cyx
 * create: 2024/11/22 17:25
 **/
@Data
public class InitiateR2PEntity {

    private String useCase;

    private String creationDateTime;

    private CreditorEntity creditor;

    private List<PaymentRequestEntity> paymentRequests;

    private String product;

    private String requestMessageId;

    private List<SettlementOptionsEntity> settlementOptions;

    private RequestReasonEntity requestReason;

    private String dueDate;


    public InitiateR2PEntity(String useCase, String creationDateTime, CreditorEntity creditor, List<PaymentRequestEntity> paymentRequests, String product, String requestMessageId, List<SettlementOptionsEntity> settlementOptions, RequestReasonEntity requestReason, String dueDate) {
        this.useCase = useCase;
        this.creationDateTime = creationDateTime;
        this.creditor = creditor;
        this.paymentRequests = paymentRequests;
        this.product = product;
        this.requestMessageId = requestMessageId;
        this.settlementOptions = settlementOptions;
        this.requestReason = requestReason;
        this.dueDate = dueDate;
    }

    public static InitiateR2PEntityBuild builder() {
        return new InitiateR2PEntityBuild();
    }

    public static class InitiateR2PEntityBuild {

        private String useCase;

        private String creationDateTime;

        private CreditorEntity creditor;

        private List<PaymentRequestEntity> paymentRequests;

        private String product;

        private String requestMessageId;

        private List<SettlementOptionsEntity> settlementOptions;

        private RequestReasonEntity requestReason;

        private String dueDate;

        InitiateR2PEntityBuild(){

        }

        public InitiateR2PEntityBuild creationDateTime(String creationDateTime) {
            this.creationDateTime = creationDateTime;
            return this;
        }

        public InitiateR2PEntityBuild creditor(CreditorEntity creditor) {
            this.creditor = creditor;
            return this;
        }

        public InitiateR2PEntityBuild paymentRequests(List<PaymentRequestEntity> paymentRequests) {
            this.paymentRequests = paymentRequests;
            return this;
        }

        public InitiateR2PEntityBuild product(String product) {
            this.product = product;
            return this;
        }

        public InitiateR2PEntityBuild requestMessageId(String requestMessageId) {
            this.requestMessageId = requestMessageId;
            return this;
        }

        public InitiateR2PEntityBuild settlementOptions(List<SettlementOptionsEntity> settlementOptions) {
            this.settlementOptions = settlementOptions;
            return this;
        }

        public InitiateR2PEntityBuild useCase(String useCase) {
            this.useCase = useCase;
            return this;
        }

        public InitiateR2PEntityBuild requestReason(RequestReasonEntity requestReason) {
            this.requestReason = requestReason;
            return this;
        }

        public InitiateR2PEntityBuild dueDate(String dueDate) {
            this.dueDate = dueDate;
            return this;
        }

        public InitiateR2PEntity build() {
            return new InitiateR2PEntity(this.useCase ,
                    this.creationDateTime ,
                                         this.creditor ,
                                         this.paymentRequests ,
                                         this.product ,
                                         this.requestMessageId ,
                                         this.settlementOptions ,

                                         this.requestReason ,
                                         this.dueDate);
        }
    }
}
